clear; clc; close all

p = 10;
n = 1000;

coeff = zeros(p,1);
x = rand(n,p);
y = zeros(n,1);
for i = 1:p,
    coeff(i) = round(10*(rand-0.5));
    y = y + coeff(i)*x(:,i);
end

y = y + 10 + rand(n,1);
fname = 'C:\Users\Mittal\Documents\Work\Code\bsccs\C\codebase\CCD\Release\test-ls.txt';
fp = fopen(fname,'w');
fprintf(fp,'"infert.stratum","infert.case","infert.intercept"');
for j = 1:p,
    arr = [char(65:90) char(97:122)];
    randstr = arr(ceil(rand(1,5)*51));
    if(j < p)
        fprintf(fp,'infert.%s, ',randstr);
    else
        fprintf(fp,'infert.%s\n',randstr);
    end
end
fclose(fp);
data = [[1:n]' y ones(n,1) x];
dlmwrite(fname,data,'delimiter',',','-append');